﻿




using System.Collections.Generic;
using System.Linq;
using Hotpot.Models;
using Hotpot.Repositories;

namespace Hotpot.Services
{
    public class LocalizationService : ILocalizationService
    {
        private readonly ILocalizationRepository repository;

        public LocalizationService(ILocalizationRepository repository)
        {
            this.repository = repository;
        }

        #region ILocalizationService Members

        public IEnumerable<Phrase> GetTranslations()
        {
            return repository.GetPhrases();
        }

        public IEnumerable<Phrase> GetTranslations(string languageCode)
        {
            return repository.GetPhrases().Where(p => p.Language == languageCode);
        }

        #endregion
    }
}
